E=expath-http-client/exist
M=expath-http-client/marklogic
S=expath-http-client/saxon

TAGSOUP=$$FG_JAVA_LIBS/org/ccil/tagsoup-1.2.jar
APACHE_CORE=$$FG_JAVA_LIBS/org/apache/httpcomponents-core-4.0.1/lib/httpcore-4.0.1.jar
APACHE_CLIENT=$$FG_JAVA_LIBS/org/apache/httpcomponents-client-4.0/lib/httpclient-4.0.jar
APACHE_LOG=$$FG_JAVA_LIBS/org/apache/commons-logging-1.1.1/commons-logging-1.1.1.jar
APACHE_CODEC=$$FG_JAVA_LIBS/org/apache/commons-codec-1.4/commons-codec-1.4.jar

expath-http-client-0.1.xar:
	mkdir expath-http-client
	mkdir $(E)
	cp ../exist/http-client.xq $(E)/expath-http-client-exist.xq
	mkdir $(M)
	cp ../marklogic/http-client.xq $(M)/expath-http-client-marklogic.xq
	mkdir $(S)
	cp ../saxon/pkg/wrapper.xq  $(S)/expath-http-client-saxon.xq
	cp ../saxon/pkg/wrapper.xsl $(S)/expath-http-client-saxon.xsl
	cp ../saxon/http-client/dist/http-client.jar $(S)/expath-http-client-saxon.jar
	mkdir $(S)/lib
	cp $(TAGSOUP)       $(S)/lib
	cp $(APACHE_CORE)   $(S)/lib
	cp $(APACHE_CLIENT) $(S)/lib
	cp $(APACHE_LOG)    $(S)/lib
	cp $(APACHE_CODEC)  $(S)/lib
	zip -r expath-http-client-0.1.xar expath-pkg.xml expath-http-client
	rm -rf expath-http-client
